import os
import types

os.environ['DJANGO_SETTINGS_MODULE'] = 'ceemtu.settings'

class CorePatternMethods:
    
    def example_method(self, pattern, file_entry):
        "This is just an example method. Does nothing."
        return False


PATTERN_METHODS = [('None', None)]
PATTERN_METHODS_MAPPING = {}

def get_methods(pattern_methods_object, group):
    for item in dir(pattern_methods_object):
        element = getattr(pattern_methods_object, item)
        if type(element) == types.MethodType:
            PATTERN_METHODS.append((item, "%s : %s" % (group, element.__doc__ and element.__doc__ or item)))
            PATTERN_METHODS_MAPPING[item] = element

from ceemtu.cetphoto.pattern_methods import PhotoPatternMethods
from ceemtu.cetmovie.pattern_methods import MoviePatternMethods
from ceemtu.cetmusic.pattern_methods import MusicPatternMethods
#from ceemtu.cetcore.pattern_methods import CorePatternMethods
get_methods(PhotoPatternMethods(), 'Photo')
get_methods(MoviePatternMethods(), 'Movie')
get_methods(MusicPatternMethods(), 'Music')
get_methods(CorePatternMethods(), 'Core')

PATTERN_METHODS = tuple(PATTERN_METHODS)
